package com.ruoyi.coffee.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @author dxj
 * @Description 分页查询对象
 * @date 2024/12/31 19:05
 */
@Data
@ApiModel(description = "分页查询Dto")
public class PageQueryDto {
    /**
     * PAGE_NUM 默认为1
     */
    private static final Integer PAGE_NUM = 1;
    /**
     * PAGE_SIZE 默认为10
     */
    private static final Integer PAGE_SIZE = 10;
    /**
     * 页码
     */
    @ApiModelProperty(value = "页码", required = true, example = "1")
    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为 1")
    private Integer pageNum = PAGE_NUM;
    /**
     * 每条页数
     */
    @ApiModelProperty(value = "每页条数", required = true, example = "10")
    @NotNull(message = "每页条数不能为空")
    @Min(value = 1, message = "每页条数最小值为 1")
    @Max(value = 100, message = "每页条数最大值为 100")
    private Integer pageSize = PAGE_SIZE;
}
